home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-progs.lha / 3D-Blitz2.lha / xspecs.asm < prev   
Encoding:
Assembly Source File  |  1980-02-06  |  1.7 KB  |  47 lines

  1.  
  2. ; X-SPECS 3D-glasses (goggles) driver, developed in fall 1988
  3. ; E-mail addresses:
  4. ;  hawkins@phast.umass.edu, UMASS Dept. of Physics and Astronomy
  5. ;  kirkstar@npvm.newpaltz.edu, SUNY New Paltz - Kirk Planetarium
  6.  
  7. ;Constants
  8. #CIAAPRA=$BFE001
  9. #CIAADDRA=$BFE201
  10.  
  11. .xspecsinit:
  12. ;Set Joyport button-0 direction to output in cia-a direction register
  13. ; for state-control of 3D-glasses
  14.   MOVE.L  D7,-(A7)    ;PRESERVE REGISTERS
  15.   CLR.L   D7           ;clear to avoid artifacts
  16.   MOVE.B  CIAADDRA,D7  ;get state of CIA-A data-direction-register-A
  17.   ORI.B   #$80,D7      ;set bit 7, for enabling button-0 as OUTPUT
  18.   MOVE.B  D7,CIAADDRA  ;set CIA-A DDRA register, enable the output
  19.   MOVE.B  CIAAPRA,D7  ;get output state
  20.   ANDI.B  #$7F,D7     ;initialize the bit to OFF
  21.   MOVE.B  D7,CIAAPRA  ;set output state
  22.   MOVE.L  (A7)+,D7  ;restore registers
  23.   Return            ;routine program end
  24.  
  25. .xspecstog:
  26. ;Toggle the STATE of the 3D-glasses
  27.   MOVE.L  D7,-(A7)   ;PRESERVE REGISTER
  28.   MOVE.B  CIAAPRA,D7  ;get output state
  29.   EOR.B   #$80,D7     ;toggle the bit, toggle the glasses
  30.   MOVE.B  D7,CIAAPRA  ;set output state
  31.   MOVE.L  (A7)+,D7  ;restore registers
  32.   Return            ;routine end
  33.  
  34. .xspecsexit:
  35. ;Clear Joyport button-0 direction to input (as is usual)
  36.   MOVE.L  D7,-(A7)    ;PRESERVE REGISTERS
  37.   CLR.L   D7           ;clear to avoid artifacts
  38.   MOVE.B  CIAADDRA,D7  ;get CIA-A data-direction-register-A
  39.   ANDI.B  #$7F,D7      ;CLEAR bit 7, to RE-enable button-0 as INPUT
  40.   MOVE.B  D7,CIAADDRA  ;set CIA-A DDRA register
  41.   MOVE.B  CIAAPRA,D7  ;get output state
  42.   ANDI.B  #$7F,D7     ;initialize the bit to OFF
  43.   MOVE.B  D7,CIAAPRA  ;set output state
  44.   MOVE.L  (A7)+,D7  ;restore registers
  45.   Return            ;routine end
  46.  
  47.